import request from '../service/service';

/**
 * 根据Id 查询组织机构信息
 */
export function getOrgById(data) {
  return request({
    protocol: '/bus/org/findById',
    options: data,
    method: 'get',
  });
}

/**
 * 新增组织机构信息
 */
export function addOrg(data) {
  return request({
    protocol: 'bus/org/create',
    options: data,
    method: 'post',
  });
}

/**
 * 修改组织机构信息
 */
export function setOrg(data) {
  return request({
    protocol: 'bus/org/update',
    options: data,
    method: 'post',
  });
}

/**
 * 删除组织机构信息
 */
export function delOrg(data) {
  return request({
    protocol: 'bus/org/deleteByIds',
    options: data,
    method: 'delete',
  });
}

/**
 * 获取机构树
 */
export function getOrgTree(data) {
  return request({
    protocol: 'bus/org/tree',
    options: data,
    method: 'get',
  });
}

/**
 * 获取机构列表
 */
export function getOrgPageList(data) {
  return request({
    protocol: 'bus/org/findPage',
    options: data,
    method: 'get',
  });
}

/**
 * 获取机构用户
 */
export function getOrgUserList(data) {
  return request({
    protocol: 'bus/org/get-orgUserList',
    options: data,
    method: 'get',
  });
}

/**
 * 机构批量添加/删除用户
 */
export function setOrgUserList(data) {
  return request({
    protocol: 'bus/org/set-orgUserList',
    options: data,
    method: 'post',
    hasQuery: true,
  });
}
